package adam.log.boot.controller;

import adam.log.boot.domain.Person;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *
 *
 * @Author adam
 * @Date 2024/02/4 14:41
 */
@Slf4j
@RestController
public class HelloController {

    @Value("${bootapp.description}")
    private String description;

    @RequestMapping("/index")
    public Person index() {
        Person p = new Person();
        p.setAge(1);
        p.setLastName("rose");
        log.trace("trace");
        log.debug("debug");
        log.info("age:{},lastName:{},desc:{}",p.getAge(),p.getLastName(),description);
        log.warn("something warn");
        log.error("something wrong");
//        System.out.println();

        return p;
    }

}
